﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;

namespace LambdaExpressions
{
    class Program
    {
        static void Main(string[] args)
        {
            var books = new List<Book>
            {
                new Book("Буратино", 10),
                new Book("Мальвина", 20),
                new Book("Му-Му", 30)
            };

            List<Book> results = books.FindAll(b => b.Price < 25);

            foreach (Book result in results)
            {
                Console.WriteLine(result.Name);
            }

        }

        static bool IsPriceLowerThan25(Book book)
        {
            return book.Price < 25;
        }
    }

    class Book
    {
        public string Name { get; set; }
        public int Price { get; set; }

        public Book(string name, int price)
        {
            Price = price;
            Name = name;
        }
    }

}
